package epoch.game.core.actor;

import epoch.game.core.common.Loggers;

public class Log {
	static String buildMessage(Actor actor, String message) {
		if (actor == null) {
			actor = AContext.ACTOR.get();
		}
		if (actor != null) {
			message = String.format("[%s] %s", actor.name, message);
		}
		return message;
	}
	static void  info(Actor actor, String message) {
		message = buildMessage(actor, message);
		Loggers.ACTOR_LOGGER.info(message);
    }
    static void error(Actor actor, String message) {
    	message = buildMessage(actor, message);
    	Loggers.ACTOR_LOGGER.error(message);
    }
	static void  info(Actor actor, String message, Throwable t) {
		message = buildMessage(actor, message);
		Loggers.ACTOR_LOGGER.info(message, t);
    }
    static void error(Actor actor, String message, Throwable t) {
    	message = buildMessage(actor, message);
    	Loggers.ACTOR_LOGGER.error(message, t);
    }
}
